package me.jessyan.mvparms.demo.mvp.model;

import com.jess.arms.integration.IRepositoryManager;
import com.jess.arms.mvp.BaseModel;

import java.util.List;

import javax.inject.Inject;

import io.reactivex.Observable;
import me.jessyan.mvparms.demo.data.api.service.MessageService;
import me.jessyan.mvparms.demo.data.entity.MessageListEntity;
import me.jessyan.mvparms.demo.data.entity.TopResponse;
import me.jessyan.mvparms.demo.mvp.contract.MessageListContract;

/**
 * @Author: 海洋
 * @Date: 2018/8/23
 * @Desc:
 */
public class MessageListModel extends BaseModel implements MessageListContract.Model {

    @Inject
    public MessageListModel(IRepositoryManager mRepositoryManager) {
        super(mRepositoryManager);
    }


    @Override
    public void onDestroy() {

    }

    @Override
    public Observable<TopResponse<List<MessageListEntity>>> getMessageList(String type, String page, String limit) {
        return mRepositoryManager
                .obtainRetrofitService(MessageService.class)
                .getMessageList(type, page, limit);
    }
}
